<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var date = new Date()
    console.log(date)

    console.log(date.toString())
    console.log(date.toDateString()) // 转换为日期字符串
    console.log(date.toLocaleDateString()) // 转换为本地日期字符串

    console.log(date.toTimeString()) // 转换为时间字符串
    console.log(date.toLocaleTimeString()) // 转换为本地时间字符串

    console.log(date.toLocaleString()) // 转换为本地日期加时间完整的字符串

    console.log(date.toUTCString()) // 转换为标准时区的日期和时间


  </script>
</body>
</html>